Optimal. Leaf size=105 \[ \frac {2 a^2 c^2 \tan ^3(e+f x)}{3 f (a \sec (e+f x)+a)^{3/2}}+\frac {2 \sqrt {a} c^2 \tan ^{-1}\left (\frac {\sqrt {a} \tan (e+f x)}{\sqrt {a \sec (e+f x)+a}}\right )}{f}-\frac {2 a c^2 \tan (e+f x)}{f \sqrt {a \sec (e+f x)+a}} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.16, antiderivative size = 105, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 4, integrand size = 28, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.143, Rules used = {3904, 3887, 302, 203} \[ \frac {2 a^2 c^2 \tan ^3(e+f x)}{3 f (a \sec (e+f x)+a)^{3/2}}+\frac {2 \sqrt {a} c^2 \tan ^{-1}\left (\frac {\sqrt {a} \tan (e+f x)}{\sqrt {a \sec (e+f x)+a}}\right )}{f}-\frac {2 a c^2 \tan (e+f x)}{f \sqrt {a \sec (e+f x)+a}} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 203
Rule 302
Rule 3887
Rule 3904
Rubi steps
\begin {align*} \int \sqrt {a+a \sec (e+f x)} (c-c \sec (e+f x))^2 \, dx &=\left (a^2 c^2\right ) \int \frac {\tan ^4(e+f x)}{(a+a \sec (e+f x))^{3/2}} \, dx\\ &=-\frac {\left (2 a^3 c^2\right ) \operatorname {Subst}\left (\int \frac {x^4}{1+a x^2} \, dx,x,-\frac {\tan (e+f x)}{\sqrt {a+a \sec (e+f x)}}\right )}{f}\\ &=-\frac {\left (2 a^3 c^2\right ) \operatorname {Subst}\left (\int \left (-\frac {1}{a^2}+\frac {x^2}{a}+\frac {1}{a^2 \left (1+a x^2\right )}\right ) \, dx,x,-\frac {\tan (e+f x)}{\sqrt {a+a \sec (e+f x)}}\right )}{f}\\ &=-\frac {2 a c^2 \tan (e+f x)}{f \sqrt {a+a \sec (e+f x)}}+\frac {2 a^2 c^2 \tan ^3(e+f x)}{3 f (a+a \sec (e+f x))^{3/2}}-\frac {\left (2 a c^2\right ) \operatorname {Subst}\left (\int \frac {1}{1+a x^2} \, dx,x,-\frac {\tan (e+f x)}{\sqrt {a+a \sec (e+f x)}}\right )}{f}\\ &=\frac {2 \sqrt {a} c^2 \tan ^{-1}\left (\frac {\sqrt {a} \tan (e+f x)}{\sqrt {a+a \sec (e+f x)}}\right )}{f}-\frac {2 a c^2 \tan (e+f x)}{f \sqrt {a+a \sec (e+f x)}}+\frac {2 a^2 c^2 \tan ^3(e+f x)}{3 f (a+a \sec (e+f x))^{3/2}}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 0.89, size = 97, normalized size = 0.92 \[ -\frac {2 c^2 \tan \left (\frac {1}{2} (e+f x)\right ) \sec (e+f x) \sqrt {a (\sec (e+f x)+1)} \left ((4 \cos (e+f x)-1) \sqrt {\sec (e+f x)-1}-3 \cos (e+f x) \tan ^{-1}\left (\sqrt {\sec (e+f x)-1}\right )\right )}{3 f \sqrt {\sec (e+f x)-1}} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.49, size = 313, normalized size = 2.98 \[ \left [\frac {3 \, {\left (c^{2} \cos \left (f x + e\right )^{2} + c^{2} \cos \left (f x + e\right )\right )} \sqrt {-a} \log \left (\frac {2 \, a \cos \left (f x + e\right )^{2} - 2 \, \sqrt {-a} \sqrt {\frac {a \cos \left (f x + e\right ) + a}{\cos \left (f x + e\right )}} \cos \left (f x + e\right ) \sin \left (f x + e\right ) + a \cos \left (f x + e\right ) - a}{\cos \left (f x + e\right ) + 1}\right ) - 2 \, {\left (4 \, c^{2} \cos \left (f x + e\right ) - c^{2}\right )} \sqrt {\frac {a \cos \left (f x + e\right ) + a}{\cos \left (f x + e\right )}} \sin \left (f x + e\right )}{3 \, {\left (f \cos \left (f x + e\right )^{2} + f \cos \left (f x + e\right )\right )}}, -\frac {2 \, {\left (3 \, {\left (c^{2} \cos \left (f x + e\right )^{2} + c^{2} \cos \left (f x + e\right )\right )} \sqrt {a} \arctan \left (\frac {\sqrt {\frac {a \cos \left (f x + e\right ) + a}{\cos \left (f x + e\right )}} \cos \left (f x + e\right )}{\sqrt {a} \sin \left (f x + e\right )}\right ) + {\left (4 \, c^{2} \cos \left (f x + e\right ) - c^{2}\right )} \sqrt {\frac {a \cos \left (f x + e\right ) + a}{\cos \left (f x + e\right )}} \sin \left (f x + e\right )\right )}}{3 \, {\left (f \cos \left (f x + e\right )^{2} + f \cos \left (f x + e\right )\right )}}\right ] \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [F(-2)] time = 0.00, size = 0, normalized size = 0.00 \[ \text {Exception raised: NotImplementedError} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 1.71, size = 142, normalized size = 1.35 \[ -\frac {c^{2} \left (3 \cos \left (f x +e \right ) \sin \left (f x +e \right ) \sqrt {2}\, \sqrt {-\frac {2 \cos \left (f x +e \right )}{1+\cos \left (f x +e \right )}}\, \arctanh \left (\frac {\sqrt {-\frac {2 \cos \left (f x +e \right )}{1+\cos \left (f x +e \right )}}\, \sin \left (f x +e \right ) \sqrt {2}}{2 \cos \left (f x +e \right )}\right )-8 \left (\cos ^{2}\left (f x +e \right )\right )+10 \cos \left (f x +e \right )-2\right ) \sqrt {\frac {a \left (1+\cos \left (f x +e \right )\right )}{\cos \left (f x +e \right )}}}{3 f \sin \left (f x +e \right ) \cos \left (f x +e \right )} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [F(-1)] time = 0.00, size = 0, normalized size = 0.00 \[ \text {Timed out} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [F] time = 0.00, size = -1, normalized size = -0.01 \[ \int \sqrt {a+\frac {a}{\cos \left (e+f\,x\right )}}\,{\left (c-\frac {c}{\cos \left (e+f\,x\right )}\right )}^2 \,d x \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [F] time = 0.00, size = 0, normalized size = 0.00 \[ c^{2} \left (\int \left (- 2 \sqrt {a \sec {\left (e + f x \right )} + a} \sec {\left (e + f x \right )}\right )\, dx + \int \sqrt {a \sec {\left (e + f x \right )} + a} \sec ^{2}{\left (e + f x \right )}\, dx + \int \sqrt {a \sec {\left (e + f x \right )} + a}\, dx\right ) \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________